//
//  HelpCenterViewController.m
//  sentorise
//
//  Created by admin on 2025/9/17.
//

#import "HelpCenterViewController.h"
#import "GlobalDefine.h"

@interface HelpCenterViewController ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topSpace;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentH1;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentH2;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *contentH3;

@property (weak, nonatomic) IBOutlet UILabel *tipsLabel1;
@property (weak, nonatomic) IBOutlet UILabel *tipsLabel2;
@property (weak, nonatomic) IBOutlet UILabel *tipsLabel3;

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (weak, nonatomic) IBOutlet UILabel *item1TitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *item1DescLabel1;
@property (weak, nonatomic) IBOutlet UILabel *item1DescLabel2;
@property (weak, nonatomic) IBOutlet UILabel *item1DescLabel3;

@property (weak, nonatomic) IBOutlet UILabel *item2TitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *item2DescLabel1;
@property (weak, nonatomic) IBOutlet UILabel *item2DescLabel2;

@property (weak, nonatomic) IBOutlet UILabel *item3TitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *item3DescLabel1;
@property (weak, nonatomic) IBOutlet UILabel *item3DescLabel2;
@property (weak, nonatomic) IBOutlet UILabel *item3DescLabel3;

@end

@implementation HelpCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.topSpace.constant = IphoneX ? 54 : 20;
    
    self.titleLabel.text = NSLocalizedString(@"Need Help", nil);
    
    self.item1TitleLabel.text = NSLocalizedString(@"How to turn on the Bluetooth module of the device?", nil);
    self.item1DescLabel1.text = NSLocalizedString(@"In the following two situations, the device's built-in Bluetooth module will turn off. You only need to charge the battery, and the Bluetooth module will turn on automatically.", nil);
    self.item1DescLabel2.text = NSLocalizedString(@"1. The battery will be defaulted to off when it is packaged at the factory.", nil);
    self.item1DescLabel3.text = NSLocalizedString(@"2. The device will automatically shut down when the battery runs out.", nil);

    self.item2TitleLabel.text = NSLocalizedString(@"How to check the Bluetooth name of the connected device", nil);
    self.item2DescLabel1.text = NSLocalizedString(@"The Bluetooth module name information has been printed on the device label sticker, and the placement may vary between different batches of products. Please check the device or package.", nil);
    self.item2DescLabel2.text = NSLocalizedString(@"How to turn on the Bluetooth module of the device", nil);
    
    self.item3TitleLabel.text = NSLocalizedString(@"Equipment Control Instructions", nil);
    self.item3DescLabel1.text = NSLocalizedString(@"-Discharge switch Controls whether the battery can be discharged.\nNote: The discharge switch is only supported by the App, please use it with caution.", nil);
    self.item3DescLabel2.text = NSLocalizedString(@"-Turn off the power Confirming that the power off willimmediately shut down the battery and disconnect the current device from Bluetooth.", nil);
    self.item3DescLabel3.text = NSLocalizedString(@"-Turn on the power Charge the battery to turn on the power and Bluetooth will also turn on at the sametime.", nil);
}

- (IBAction)actionBack:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)actionShow1:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.contentH1.constant = sender.selected ? 300 : 90;
    self.tipsLabel1.hidden = !sender.selected;
}

- (IBAction)actionShow2:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.contentH2.constant = sender.selected ? 210 : 90;
    self.tipsLabel2.hidden = !sender.selected;
}

- (IBAction)actionShow3:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.contentH3.constant = sender.selected ? 350 : 80;
    self.tipsLabel3.hidden = !sender.selected;
}


@end
